package com.dingding.special.user.customer.dao.impl;

import java.util.List;

import javax.annotation.Resource;

import org.apache.log4j.Logger;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;

import com.dingding.common.core.base.daox.ISQLBaseDao;
import com.dingding.common.core.beans.Userdetail;
import com.dingding.special.user.customer.dao.ICustomerUserDao;

@Component("customerUserDao")
public class CustomerUserDaoImpl implements ICustomerUserDao {

	Logger log = Logger.getLogger(this.getClass());

	@Resource(name = "SQLBaseDao")
	private ISQLBaseDao baseDao;
	
	@Override
	@Transactional(readOnly = true)
	public Userdetail getUserdetail(String userId) {
		
		List<Userdetail> list = this.baseDao.listSqlToCustomBean(
				Userdetail.class, "select * from userdetail where loginId = ?", userId);
		
		if(list == null || list.size() == 0){
			return null;
		}else{
			return list.get(0);
		}
	}
	
	
}
